package 集合;

import java.util.Iterator;
import java.util.List;

public class SimpleIteration {
	public static void main(String[] args) {
		List<Integer> list = ListUse.createList();
		Iterator<Integer> iterator = list.iterator();
		while (iterator.hasNext()) {
			Integer integer = iterator.next();
			System.out.println(integer);
			if (integer <= 3) {
				// remove 会删除 iterator.next() 产生出来的最后一个元素
				iterator.remove();
			}
		}
		System.out.println(list);
	}
}
